<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></script>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">  
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<title>Insert title here</title>
</head>
<body ng-app="myApp" ng-controller="myController">
<div class="col-md-4 compose-right widget-shadow">
<div class="table-responsive">
  <table class="table">
		<caption>用户操作</caption>
		<thead>
			<tr>
			    <th>id</th>
				<th>用户名</th>
				<th>密码</th>
				<th>邮箱</th>
				<th>操作</th>
		
			</tr>
		</thead>
		<tbody id="tb">
			
			<tr ng-repeat="u in rs">
			      <td>{{u.id}}</td>
		         <td>{{u.name}}</td>
			    <td>{{u.pwd}}</td>
			    <td>{{u.email}}</td>    
		       	<td><a href="javascript:void(0)" ng-click="update(u.id)">修改</a>&nbsp&nbsp<a href="javascript:void(0)" ng-click="delete1(u.id)">删除</a></td>
			</tr>
		
		</tbody>
</table>
          
</div>
</div>
<div class="col-md-8 compose-right widget-shadow">
			<div class="main-page">
				<br>
				<button class="btn btn-success" ng-click="update(0)">
					  <span class="glyphicon glyphicon-plus"></span> 新建用户
				</button>
				<br>
				<div class="table-responsive bs-example widget-shadow">
					<hr>
					<h3 ng-show="edit">新建用户:</h3>
					<h3 ng-hide="edit">编辑用户:</h3>
					<form class="form-horizontal">
						<div class="form-group" style="display: none">
							  <label class="col-sm-2 control-label">id:</label>  
							<div class="col-sm-8">
								    <input class="form-control" type="number" ng-model="id">
								 
							</div>
						</div>
						<div class="form-group">
							  <label class="col-sm-2 control-label">用户名:</label>  
							<div class="col-sm-8">
								    <input class="form-control" type="text" ng-model="name"
									placeholder="用户名">  
							</div>
						</div>
						<div class="form-group">
							  <label class="col-sm-2 control-label">密码:</label>  
							<div class="col-sm-8">
								<textarea class="form-control" rows="4" ng-model="pwd"
									placeholder="密码"></textarea>
								 
							</div>
						</div>
						<div class="form-group">
							  <label class="col-sm-2 control-label">邮箱:</label>  
							<div class="col-sm-8">
								<textarea class="form-control" rows="4" ng-model="email"
									placeholder="邮箱"></textarea>
								 
							</div>
						</div>
					</form>

					<hr>
					<button class="btn btn-success" ng-disabled="incomplete"
						ng-click="save()">
						  <span class="glyphicon glyphicon-save"></span> 保存改动
					</button>
				</div>
			</div>
			
		</div>
<script type="text/javascript" src="/test/js/show.js"></script>
</body>

</html>